<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="renderer" content="webkit" />
        <title>上海羿尧科技有限公司--随时随地随心随身WIFI</title>
        <link href="../css/basic.css" rel="stylesheet" type="text/css" />
        <link href="../css/main.css" rel="stylesheet" type="text/css" />
        <script src="../js/jquery-1.11.3.min.js"></script>
        <script src="https://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
        <script src="../scripts/unit/Unit.js"></script>
        <script src="../scripts/services/FlowChargeSrv.js"></script>
        <script src="../scripts/controllers/FlowChargeCtrl.js"></script>
        <meta charset="utf-8" />
        <style>
            #qcode{position:fixed;top:73%;left:49%;background:#eee;padding:10px;}
            #qcode img{border:none;width:150px;height:150px;}
        </style>
    </head>
    <body ng-app="FlowCharge" ng-controller="OrderController">
        <div style="background:#f1f1f1;border-bottom:1px solid #e5e5e5">
            <div class="wrap_w">
                <div class="padd_tb15 marginl10"><img src="../image/logo.png" /></div>
            </div>
        </div>
        <div class="wrap_w w_cont" style="margin:30px auto 0">
            <div class="order_site"><span>您现在的位置：</span><a href="javascript:history.back()">流量卡购买</a> << 提交订单</div>
            <div class="c_order_h">确认订单信息：</div>
            <div class="c_marg50 c_o_info clearfix">
                <ul>
                    <li>
                        <span class="c_name">商品信息</span>
                        <span class="c_text"><?php echo $info['cardItem']['title'] ?></span>
                    </li>
                    <li>
                        <span class="c_name">商品属性</span>
                        <span class="c_text"><?php echo $info['cardItem']['itemName'] ?></span>
                    </li>
                    <li>
                        <span class="c_name">单价（元）</span>
                        <span class="c_text"><?php echo $info['cardItem']['price'] ?></span>
                    </li>
                    <li>
                        <span class="c_name">数量</span>
                        <span class="c_text"><?php echo $info['cardCount'] ?></span>
                    </li>
                    <li>
                        <span class="c_name">优惠</span>
                        <span class="c_text"><em class="youhui">无</em></span>
                    </li>
                    <li>
                        <span class="c_name">小计</span>
                        <span class="c_text"><em class="price"><?php echo $info['cardCount'] * $info['cardItem']['price'] ?>.00</em></span>
                    </li>
                </ul>
            </div>
            <div class="clearfix"></div>
            <div class="c_order_h">确认收货地址：</div>
            <div class="c_marg50 c_o_adress clearfix">
                <div class="fl"><img src="../image/dress1.png" /></div>
                <div class="fl cont_bg">
                    <div class="a_line"><?php echo $info['address']['consignee'] ?> （收） <em class="phone"><?php echo $info['address']['phone'] ?> </em></div>
                    <div class=""> <?php echo $info['address']['provinceName'] . " " . $info['address']['cityName'] . " " . $info['address']['districtName'] . " " . $info['address']['street']; ?> </div>
                </div>
                <div class="fl"><img src="../image/dress3.png" /></div>
            </div>
            <div class="clearfix"></div>
            <div class="c_order_h">配送方式：</div>
            <div class="c_marg50 c_o_info padd_15 clearfix">
                <div class="clearfix s_method"><span class="block fl">普通配送：快递</span><span class="block fr express_p">快递费：<?php echo $info['cardItem']['express']; ?>元</span></div>
                <div class="time marginT10">18：00前付款，预计<?php echo date("m月d号", strtotime("2 days")); ?>（后天）送达</div>
            </div>
            <div class="c_order_h">支付方式：
                <?php
                if ($info['selectPayWayIndex'] == 1) {
                    echo ' <span class="order_pay"> <img src="../image/icon1.png" width="24" />微信支付</span>
                    ';
                } else {
                    echo '<span class="order_pay"><img src="../image/icon2.jpg" width="24" />支付宝支付</span>';
                }
                ?>


            </div>
            <div class="c_o_price">实付款：<em>¥<?php echo $info['cardCount'] * $info['cardItem']['price'] + $info['cardItem']['express']; ?>.00元</em></div>
            <div class="clearfix"></div>

            <?php if ($info['selectPayWayIndex'] == 1): ?>
                <div class="fr" ><input style="cursor:pointer;"class="c_o_btn" type="button" value="提交订单" ng-click="wechatPay()" id="wechat-btn"/></div>

            <?php else: ?>
                <div class="fr"><a style="cursor:pointer;" href="card_buy_remote.php" class="c_o_btn" target="_blank"  />提交订单</a></div>

            <?php endif; ?>

            <!-- 微信二维码框 -->
            <div class="box_w" ng-show="QRCODE_BOX_VISABLE == true">
                <div class="box2_w" id="qcode-box">
                    <div class="box_back_w">
                        <div class="q_order_w">
                            <h2>微信支付</h2>
                            <a class="close" ng-click="QRCODE_BOX_VISABLE = false"></a>
                        </div>
                        <div class="q_order1">
                            <div class="line ac">
                                付款：
                                <em class="price"><?php echo $info['cardCount'] * $info['cardItem']['price'] + $info['cardItem']['express']; ?>.00元</em>
                            </div>
                            <div class="line wei_bg">
                                <div id="qcode">
                                    <img src="{{wechatQcode}}" alt="" />
                                </div>
                            </div>
                            <div class="line ac">
                                打开手机微信扫一扫继续付款
                            </div>
                        </div>
                    </div>
                </div>
            </div>
          
            <!-- 支付成功弹出框 -->
            <div class="box_s" id="success-box" ng-show="SUCCESS_BOX_VISABLE==true">
                <div class="box2_s">
                    <div class="box_back_s">
                        <div class="q_order_s">
                            <h2>微信支付</h2>
                            <a class="close" ng-click="SUCCESS_BOX_VISABLE=false"></a>
                        </div>
                        <div class="q_order1">
                            <div class="line ac">
                                <img src="../image/gou.png" />
                            </div>
                            <div class="line ac">
                                &yen;：<em class="price"><?php echo $info['cardCount'] * $info['cardItem']['price'] + $info['cardItem']['express']; ?>.00元</em>
                            </div>
                            <div class="line ac c_g">
                                支付成功
                            </div>
                            <div class="line">
                                <a href="card_buy.php" class="success">完 成</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>







        </div>
        <iframe frameborder="0" border="0" scrolling="no" width="100%" height="35" src="../views/footer.html" mce_src="../views/footer.html"></iframe>

        <script>



                            var app = angular.module('FlowCharge',
                                    ['FlowCharge.unit', 'FlowCharge.controller', 'FlowCharge.service'])
                                            .constant('BASE_URL', 'http://localhost/charge/');








                            /*
                             var timeHandler;
                             $('#wechat-btn').click(function(){
                             if ($(this).attr('pending')) {
                             return;
                             }
                             clearInterval(timeHandler);
                             $(this).css("background-color", "#ccc").attr('pending', '1');
                             $.ajax({
                             url: 'card_buy_remote.php',
                             type: 'POST',
                             data: {},
                             dataType: 'json',
                             cache: false,
                             error: function () {}, //错误执行方法
                             success: function (data) {
                             
                             
                             $('#qcode img').attr('src', "http://paysdk.weixin.qq.com/example/qrcode.php?data=" + encodeURI(data.code_url));
                             $('#qcode').show();
                             timeHandler = setInterval(orderStatus(data['out_trade_no']), 3000);
                             
                             //console.log(data);
                             } //成功执行方法
                             })
                             
                             })
                             
                             
                             function orderStatus(out_trade_no) {
                             
                             return function () {
                             
                             $.ajax({
                             url: 'orderStatus.php?out_trade_no=' + out_trade_no,
                             type: 'GET',
                             dataType: 'json',
                             cache: false,
                             beforeSend: function () {}, //加载执行方法
                             error: function () {}, //错误执行方法
                             success: function (data) {
                             if (data.success) {
                             
                             alert("支付成功");
                             $('#wechat-btn').css("background-color", "#f3353a").removeAttr('pending', '1');
                             //隱藏
                             
                             }
                             
                             } //成功执行方法
                             })
                             
                             }
                             
                             }
                             */

        </script>



    </body>
</html>
